import Error from './error/index';
import Loading from './loading/index';

const componentList = [Error, Loading];
export default {
  // install: Vue =>
  //   componentList.forEach((rec) => {
  //     Vue.component(rec.name, rec.compontent);
  //     if (rec.actionName) {
  //       Vue.prototype[rec.actionName] = rec.extFun;
  //     }
  //   }),
  install: (Vue) => {
    componentList.forEach((rec) => {
      Vue.component(rec.name, rec.compontent);
      if (rec.actionName && rec.extFun) {
        // eslint-disable-next-line
        Vue.prototype[rec.actionName] = rec.extFun;
      }
    });
  },
};
